import moment from 'moment';

export function toDate(date: string | Date, inputFormat?: string) {
    return moment(date, inputFormat).format('YYYY-MM-DD');
}

export function toTime(time: string | Date, inputFormat?: string) {
    return moment(time, inputFormat).format('HH:mm:ss');
}

export function toDisplayDate(date: string | Date, inputFormat?: string) {
    return moment(date, inputFormat).format('YYYY MMM DD');
}
